%option noyywrap 
%{
#include <iostream>
#include "lang.hh"

# define YY_DECL yy::parser::symbol_type yylex()
YY_DECL;

%}

%%

"U64" return yy::parser::make_F64(Type{F64, 4, 4});
"I64" return yy::parser::make_I64(Type{F64, 4, 4});
"CHAR" return yy::parser::make_CHAR(Type{F64, 4, 4});
"F64" return yy::parser::make_F64(Type{F64, 4, 4});

[_a-zA-Z]\w* return yy::parser::make_ID(yytext);

";" return yy::parser::make_SEMICOLON();

[ \n\t\r] { /* skip */ }
. { std::cerr << "shit! out of flex.\n"; exit(-1); }

<<EOF>> return yy::parser::make_YYEOF();

%%
